<?php

namespace app\models;

class Relation extends \app\libs\orm\Model
{
    public $id;
    public $person1;
    public $person2;

    public function person1()
    {
        return Person::find($this->person1);
    }

    public function person2()
    {
        return Person::find($this->person2);
    }

    public function children()
    {
        return Person::find(['parents' => $this->id]);
    }
}